﻿using System.Dynamic;

namespace Flux.Data.Utilities
{
	public class TileHelper
	{
		public static int GetIndex(int x, int y, int width)
		{
			var index = y * width + x;
			return index;
		}

		public static dynamic GetXY(int index, int width)
		{
			var x = index % width;
			var y = index / width;
			dynamic ret = new ExpandoObject();
			ret.X = x;
			ret.Y = y;
			return ret;
		}
	}
}
